The LSAOrgaUnit is the main class of the LSA Orga Interface. Every entity within the LSA Orga
database (groups, persons, traits) are LSAOrgaUnit objects.
All properties or methos which don't have a description here are for internal use only .
- Author:
-
LPS EMEA
- Version:
-
1.1.y, 18.APR.2000
- History:
| 09.May.2000 | RPr | changed errorhandlers with Errormessages
30.Aug 2000 RPr Bugfix read from LSAOrgDelimiters instead of LSAOrgDelimiter Field in New method
12.SEP.2000 RPr set flag IsSummary to TRUE in WriteCustomerData
09.OCT.2000 RPr Bugfix setting field "LSAOrgAddressInterface"
09.OCT.2000 RPr Bugfix generating trait reference strings
22.JAN.2001 RPr Added DefaultHierarchyPath Property
|
| Method Summary |
Function ConvertFormula (Instring As String) As String |
Function CreateUnitDoc () As NotesDocument |
Sub Delete () |
Function FormulaEvaluate (formula As String, doc As notesdocument) As Variant |
Function GetChildsSurrogation (Child As LSAOrgaUnit) As LSAOrgaCollection |
Function getCustomerContactSearchCriterias () As Variant |
Function getCustomerOrganizationSearchCriterias () As Variant |
Function getCustomerSerialData () As String |
Function getDisplayName () As String |
Function getOrganizationData () As String |
Function getOrganizationS () As Variant |
Function getPersonData () As String |
Function getReference () As String |
Function HasChild (Child As Variant, as As Variant, LSAOrgaUnit As Variant) As Variant |
Function HasParent (Parent As Variant, as As Variant, LSAOrgaUnit As Variant) As Variant |
Sub New (AttribCorrespondingDocument As NotesDocument, AttribDisplayName As String, AttribNotesName As String, AttribNotesType As String, AttribOrgaType As LSAOrgaType, orgaDB As NotesDatabase, OrgaLog As LSAOrgaLog, SurrogationDate As NotesDateTime, parViewAllUnits As NotesView, paraddrview As NotesView, addrMgrID As String) |
Function ReadCustomerData (field As String) As Variant |
Sub Remove () |
Function Save () As Integer |
Sub SaveWithoutUpdate (strPropertyName As String, vNewValue As Variant) |
Sub setAllPropertiesAccordingToType () |
Sub SetChildsSurrogation (Child As LSAOrgaUnit, Surrogates As LSAOrgaCollection) |
Function SetDefaultHierarchyFromParent (ParentUnit As Variant, as As Variant, LSAOrgaUnit As Variant) As Variant |
Sub SetNotesTypeAccordingToType (strNABGroupType As String) |
Sub UpdateSerialData () |
Function validAliasNames (AliasNamesToCheck As Variant) As Integer |
Sub WriteCustomerData (field As String, value As Variant) |
Public Property Set UnavailabilityTimeS AsVariant
This property sets times of unavailibility for units (person and groups, not traits). The value has to be
set as list of dates or date ranges. For date ranges the begin and the end has to be separated by using a
dash ("-"). The separator has to be set as "/" or "." regardless of the operating system used.
Use Case:
We want to set unavailability times for a person unit:
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allTimes As Variant
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If not aOrgaUnit is Nothing then
Redim allTimes(1) As String
allTimes(0) = "1.12.2000"
allTimes(1) = "13.11.2000 - 24.11.2000"
aOrgaUnit.UnavailabilityTimeS = allTimes
call aOrgaUnit.save
Delete aOrgaUnit
End If
- Parameters:
| UnavailabilityTimeS | Variant | String or array of strings containing the dates and/or date-ranges.
|
- History:
Public Property Get UnavailabilityTimeS AsVariant
This property reads the times of unavailibility for units (person and groups, not traits).
If no unavailability times are defined an empty string will be returned.
Use Case:
We want to read the unavailability times for a person unit:
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allTimes As Variant
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If not aOrgaUnit is Nothing then
allTimes = aOrgaUnit.UnavailabilityTimeS
End If
- Returns:
| UnavailabilityTimeS | Variant Times of unavailability as a list of dates or dateranges
|
- History:
Public Property Set UserAccessAuthorS AsVariant
This property sets author access rights for units (for documents of persons, groups and traits). Persons or
groups can be authorized to edit documents in LSAOrga.
The roles given in LSA-Orga cannot be overwritten by using this property. Using this property means that the
old values will be overwritten. So it may be necessary to read the old values before writing the new values.
Use Case:
We want to add the role "[TestRoles]" to the author access field in the "Testperson" unit
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allAuthors As Variant
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
allAuthors = aOrgaUnit.UserAccessAuthors
Redim Preserve allAuthors(Ubound(allAuthors)+1) As String
allAuthors(Ubound(allAuthors)) = "[TestRoles]"
aOrgaUnit.UserAccessAuthors = allAuthors
Call aOrgaUnit.save
Delete aOrgaUnit
End If
- Parameters:
| UserAccessAuthorS | Variant | Persons and/or groups that should be able to do changes to the unit document
|
- History:
Public Property Get UserAccessAuthorS AsVariant
This property reads all person and/or groups which have author access rights for a unit document. In addition to
this property access rights for unit documents can be given by using the roles defined in LSA-Orga.
In the case of no access right definition for a unit "Empty" will be returned.
Use Case:
We want to read the author access rights in the "Testperson" unit
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allAuthors As Variant
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
allAuthors = aOrgaUnit.UserAccessAuthors
End If
- Returns:
| UserAccessAuthorS | Variant Persons and/or groups that are able to do changes to the unit document
|
- History:
Public Property Get OrgaType AsLSAOrgaType
This property reads the Orga type of units as defined in the meta modell.
For example the result can be the type "external employee" or "internal employee" for a person.
Use Case:
we want to get the Orga Type object of the Testperson:
Dim OrgaManager As New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim OrgaUnit As LSAOrgaUnit
Dim aOrgaType as LSAOrgaType
Set OrgaUnit = OrgaManager.GetUnitByName("TestPerson")
If Not OrgaUnit Is Nothing Then
aOrgaType = OrgaUnit.OrgaType
End If
- Returns:
| OrgaType | LSAOrgaType Type object as defined in the meta modell of LSA-Orga.
|
- See also:
- History:
Public Property Set NotesType AsString
This property sets the NotesType of units for persons, groups and traits. If the NotesType to be
set is not allowed like defined in the meta modell of the appropriate document no error message will
come up. The Notestype will be set like defined in the meta modell.
Values for groups and traits:
"0" = Multi purpose (Default)
"1" = Mail only
"2" = Access control list only
"3" = Deny list only
"5" = None
Values for persons:
"NAB" = from NAB
"Orga" = Non-NAB
"Interface" = choose when created
Non-NAB users will not be synchronized with the domino directory. But if they have a valid NotesName they
will be generated into domino directory groups - the latter is only possible if the units are of the
NotesType "Interface".
The NotesType of a unit must match the NotesType of its type definition: except for the NotesType
"Choose when created" in the type definition the NotesType of the unit must always be the same as in the type
definition. You cannot set the NotesType of a Unit to a value that does not match with the type
definition - if you do, this change will not be saved, but the value from the type definition will be set
into the unit.
If you have a NotesType for groups from 0-3, for persons "NAB", you must also set the NotesName of the unit
to a not empty string, otherwise this unit will not be saved. If you change the NotesType from a value with
a NotesName to a value without NotesName, the NotesNames in the units will be set to an empty string.
Use Case:
you want to set the NotesType of the Testperson to "Interface" (only possible if also in the OrgaType of
this unit specified with "Interface" or "Choose when created"):
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
aOrgaUnit.NotesType = "Interface"
Call aOrgaUnit.save
Delete aOrgaUnit
End If
- Parameters:
| NotesType | String | Type of group or trait for domino directory and kind of person in LSA-Orga
|
- See also:
- History:
Public Property Get NotesType AsString
This property reads the Notes type of units for persons, groups and traits.
For groups and traits:
0 = Multi purpose (Default)
1 = Mail only
2 = Access control list only
3 = Deny list only
5 = None
For persons:
"NAB" = from NAB
"Orga" = Non-NAB
"Interface" = choose when created
Use Case:
you want to read the NotesType of the "Testperson" unit :
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim aNotesName as String
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
aNotesName = aOrgaUnit.NotesType
End If
- Returns:
| NotesType | String Type of group or trait for domino directory and indicator if person has NotesName
in LSA-Orga
|
- See also:
- History:
Public Property Set NotesName AsString
This property sets the Notesname of a unit (group, person or trait). For groups and traits the NotesName
is the name of the group for its appropriate group in the domino dircctory, for person unit its canonical
Notes username. The NotesName has to be unique in the LSA-Orga database. Otherwise this unit will not be
saved, and an entry will be created in the Log Database:
"LSAOrgaUnit.Save : [Unit.DisplayName] - 16001 - This notes name already exists"
The change of the NotesName must be populated throughout the whole LSAOrga database, that's why it is necessary
to finally call the "LSAOrgaManager.PopulateAllChanges" method or run the agent "LSAOrgEng cUpdate" in the
LSAOrga database.
Use Case:
we want to set a NotesName for the "Testperson" unit
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success As Integer
Set aOrgaUnit = OrgaManager.GetUnitByName("TestPerson")
If Not aOrgaUnit Is Nothing Then
aOrgaUnit.NotesName = "Testperson"
success = aOrgaUnit.save
Delete aOrgaUnit
End If
If success Then Call OrgaManager.PopulateAllChanges
- Parameters:
| NotesName | String | Group name of domino directory for groups and traits, canonical Notes username for persons.
|
- See also:
- History:
Public Property Get NotesName AsString
This property reads the NotesName of a unit (group, person or trait). For groups and traits the NotesName
is the name of the group for its appropriate group in the domino directory. For person it's the canonical
Notes username. The NotesName is unique in the LSAOrga database.
Use Case:
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim aNotesName as String
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
aNotesName = aOrgaUnit.NotesName
Messagebox aNotesName
End If
- Returns:
| NotesName | String Group name of domino directory for groups and traits, canonical Notes username for persons.
|
- See also:
- History:
Public Property Set Delimiter AsVariant
This property sets the list of all possible delimiters of the LSAOrga database for the serial data strings.
With this property you can only add delimiters to the one which already exist by default in the LSAOrga,
these are: "|"; "#"; "~"; "\"; "*" .
- Parameters:
| Delimiter | Variant | all additional delimiters
|
- History:
Public Property Get Delimiter AsVariant
This property reads the list of all possible delimiters of the LSA-Orga database for the serial
strings (e.g. "|" oder "~" etc). It can be more than the default delimiters, if the default
delimiter list was enlarged by the setting more delimiters.
- Returns:
| Delimiter | Variant all allowed delimiters
|
- History:
Public Property Set DisplayName AsString
This property changes the name (displayname) of a unit. The displayname is the unique name of the unit in
the LSAOrga database. Changing the displayname has also affect on other units. This affected changes will be
done after running the method PopulateAllChanges. If you specify a displayName which already exists, the unit
will not be saved and a message is created in the Log database:
"LSAOrgaUnit.Save :
[UnitDisplayName] - 16000 - A unit with this displayname already exists!
Use Case:
We want to change the displayname of the unit "Test" into "Testperson":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success As Integer
Dim aUnitName As String
Set aOrgaUnit = OrgaManager.GetUnitByName("Test")
If Not aOrgaUnit Is Nothing Then
aOrgaUnit.DisplayName = "Testperson"
success = aOrgaUnit.save
Delete aOrgaUnit
End If
If success Then Call OrgaManager.PopulateAllChanges
- Parameters:
| DisplayName | String | Unique name of a unit in the LSA-Orga database
|
- History:
Public Property Get DisplayName AsString
This property reads the unique name of a unit in the LSAOrga database (displayname).
- Returns:
| Displayname | String Unique name of a unit in the LSA-Orga database
|
- See also:
- History:
Public Property Set Description AsString
This property sets the description (additional information, remark) of a unit (group, person or trait).
Use Case:
We want to change the description of the unit "Projektgruppe":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success as Integer
Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
If Not aOrgaUnit Is Nothing Then
aOrgaUnit.Description = "Unit for Interface Test"
success = aOrgaUnit.save
Delete aOrgaUnit
End If
- Parameters:
| Description | String | Description of unit (group, person or trait).
|
- History:
Public Property Get Description AsString
This property reads the description of a unit (group, person or trait).
Use Case:
We want to read the description of the unit "Projektgruppe":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
If Not aOrgaUnit Is Nothing Then
Messagebox aOrgaUnit.Description
End If
- Returns:
| Description | String Description of a unit (group, person or trait).
|
- History:
Public Property Get PersonData AsLSAOrgaPersonRecord
This property is for accessing person related data: Firstname; Lastname; Title; MiddleInitial; Suffix;
Gender.
The values can only be read using this property.
For setting data the properties of the class LSAOrgaPersonRecord have to be used.
Use Case:
We want to set the person data into the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success As Integer
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
aOrgaUnit.personData.FirstName = "Martin"
aOrgaUnit.personData.LastName = "Smith"
aOrgaUnit.personData.MiddleInitial = "R."
aOrgaUnit.personData.Title = "Dr."
aOrgaUnit.personData.Gender = "M"
success = aOrgaUnit.save
Delete aOrgaUnit
End If
'read the PersonData:
Dim allPersonData As LSAOrgaPersonRecord
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
Set allPersonData = aOrgaUnit.PersonData
Messagebox allPersonData.FirstName + " " + allPersonData.MiddleInitial + " " + allPersonData.lastName
End If
- Returns:
| LSAOrgaPersonRecord | Object of a person record in LSA-Orga
|
- History:
Public Property Set FormulaForSerialData AsVariant
One or more formulas for calculation of the user interface data (LotusU). The formulas are the same as in the
appropriate fields of the customer subforms. The formulas for the fields have to be set in the following sequence:
1. LSCOrgIntData, 2. LSCOrgIntSearchCriteria, 3. LSCAddrIntData, 4. LSCAddrIntContactSearch,
5. LSCAddrIntOrganizationSearch.
The formulas only exist in the objects after setting them. They will not be saved to the document. Only the
calculated fields will exist. If a formula is "" (empty string), no evaluation will take place.
The fields can be deleted by setting " " (space) for the formula.
- Parameters:
| FormulaForSerialData | Variant | Formulas for setting the LotusU fields of the user interface.
|
- History:
Public Property Get SerialInterfaceData AsVariant
This property is only for reading. It delivers the client specific data defined in the user interface
in the LotusU format.
The values of the fields were calculated by using the formulas of the poperty "FormulaForSerialData".
The values come up in the following sequence: 1. LSCOrgIntData, 2. LSCOrgIntSearchCriteria, 3. LSCAddrIntData,
4. LSCAddrIntContactSearch, 5. LSCAddrIntOrganizationSearch).
- Returns:
| SerialInterfaceData | Variant Values of the user interface fields listed below
|
- History:
Public Property Set DefaultSurrogateS AsLSAOrgaCollection
This property sets the default surrogate(s) for a unit (person, group or trait) as it can be done in the
user interface of the LSA-Orga. As this property replaces all existing surrogates, you have to read out
first the existing surrogates and add your new ones.
Use Case:
We want to add a new Default Surrogate for the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim surrogate As LSAOrgaUnit
Dim allDefaultSurrogates As LSAOrgaCollection
Dim success As Integer
Set aOrgaUnit = OrgaManager.GetUnitByName("TestPerson")
Set Surrogate = OrgaManager.GetUnitByName("Test")
If Not aOrgaUnit Is Nothing And Not surrogate Is Nothing Then
Set allDefaultSurrogates = aOrgaUnit.DefaultSurrogates
Call allDefaultSurrogates.addEntry (Surrogate)
Set aOrgaUnit.DefaultSurrogates = allDefaultSurrogates
success = aOrgaUnit.save
Delete aOrgaUnit
Delete Surrogate
Call allDefaultSurrogates.deleteAll
End If
- Parameters:
| DefaultSurrogateS | LSAOrgaCollection | all surrogates for the unit
|
- History:
Public Property Get DefaultSurrogateS AsLSAOrgaCollection
This poperty returns a LSAOrgaCollection with the default surrogate(s) of a unit.
Use Case:
We want to get the names of all default surrogates of the "Testperson":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim surrogate As LSAOrgaUnit
Dim allDefaultSurrogates As LSAOrgaCollection
Dim allNames As String
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
Set allDefaultSurrogates = aOrgaUnit.DefaultSurrogates
Set Surrogate = allDefaultSurrogates.GetFirst()
allNames = ""
While Not Surrogate Is Nothing
If allNames = "" Then
allNames = Surrogate.DisplayName
Else
allNames = allNames + "; " + Surrogate.DisplayName
End If
Set Surrogate = allDefaultSurrogates.GetNext()
Wend
Messagebox allNames
End If
- Returns:
| DefaultSurrogateS | LSAOrgaCollection all surrogates for the unit
|
- History:
Public Property Get SyncInfo AsLSASync
This property is a read only property. With the information in the SyncInfo you can check synchronization
data, if you synchronize your unit with external data sources.
The SyncInfo can be set using the method "SyncInfo.SetExtSync". It can be read using the following syntax:
LSAOrgaUnit.SyncInfo.Syncdata
Use Case:
When a new unit is created from the backend we indicate this with the Synchronization Information
Dim OrgaType As LSAOrgaType
Dim OrgaManager As New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit As LSAOrgaUnit
'Create a new Department unit:
Set OrgaType = OrgaManager.GetTypeByName("Department")
Set Unit = OrgaManager.NewUnit("Sales2", OrgaType, "Sales2", "0")
Call Unit.SyncInfo.SetExtSync("Interface","SourceSales2",Now)
Call Unit.Save()
- Returns:
| SyncInfo | LSASync LSASync object
|
- See also:
- History:
Public Property Get AddresseS AsLSAAddressData
This poperty returns a LSAAddressData object, which holds all address data of the unit. To work with address
data of a organization unit you must use this property of the unit, otherwise inconsistencies of the address
data will occur.
- Returns:
- See also:
- History:
Public Property Get AliasNotesNameS AsLSAOrgaAliasseS
This poperty returns a LSAOrgaAliasseS object with all alias names of a unit.
Note: before LiSA Version 2.0c there is a bug when trying to read the expiration dates.
Use Case:
we want to read the names and expiration dates of the current alias names and set a new one for
the group "Sales2":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allAliasses As LSAOrgaAliasseS
Dim allNames As Variant
Dim expirationDateItem As Variant
Dim expirationDate As Variant
Dim aKey As String
Dim newAlias As LSAOrgaAliasItem
Set aOrgaUnit = OrgaManager.GetUnitByName("Sales2")
If Not aOrgaUnit Is Nothing Then
Set allAliasses = aOrgaUnit.AliasNotesNames
allNames = aOrgaUnit.AliasNotesNames.AliasNames
Forall aName In allNames
aKey = aName
Set expirationDateItem = aOrgaUnit.AliasNotesNames.GetItemByKey(aKey, False) 'don't move the current item
expirationDate = expirationDateItem.ExpirationDate
Messagebox "Alias: " + aName + " expires: " + Cstr(expirationDate)
End Forall
Set newAlias = New LSAOrgaAliasItem("Verkauf 2", "31.12.2001")
Call aOrgaUnit.AliasNotesNames.AddItem(newAlias)
Call aOrgaUnit.save
End If
- Returns:
| AliasNotesNameS | LSAOrgaAliasseS
|
- History:
Public Property Set ParentS AsLSAOrgaCollection
This property sets the parents of units for persons, groups and traits. More than one parent can be set
by using this property. Changing parents has also affect on the hierarchy and on other units. For this
issue an update request will be created. The changes will take place after running the method "PopulateAllChanges".
For changing the parents of a unit all parents have to be set. The property itself checks which units have to be
added and which units have to be deleted.
Use Case:
we want to set "Testperson" as Child into the "Sales2" Department
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim parent As LSAOrgaUnit
Dim allParents As LSAOrgaCollection
Dim success As Integer
Set aOrgaUnit = OrgaManager.GetUnitByName("TestPerson")
Set Parent= OrgaManager.GetUnitByName("Sales2")
If Not aOrgaUnit Is Nothing And Not parent Is Nothing Then
Set allParents = aOrgaUnit.Parents
Call allParents.addEntry (Parent)
Set aOrgaUnit.Parents = allParents
success = aOrgaUnit.save
Delete aOrgaUnit
Delete Parent
Call allParents.deleteAll
End If
If success Then Call OrgaManager.PopulateAllChanges
- Parameters:
| Parents | LSAOrgaCollection | Collection of units
|
- History:
Public Property Get ParentS AsLSAORgaCollection
This property reads all the parents of a unit for persons, groups and traits. All units in which the object is a
member will be part of the collection. If there is no parent the collection will be empty.
Use Case:
We read the parents of the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim parent As LSAOrgaUnit
Dim allParents As LSAOrgaCollection
Dim allNames As String
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
Set allParents = aOrgaUnit.Parents
Set Parent = allParents.GetFirst()
allNames = ""
While Not Parent Is Nothing
If allNames = "" Then
allNames = Parent.DisplayName
Else
allNames = allNames + "; " + Parent.DisplayName
End If
Set Parent = allParents.GetNext()
Wend
Messagebox allNames
End If
- Returns:
| Parents | LSAOrgaCollection Collection of units
|
- History:
Public Property Set Children AsLSAOrgaCollection
This property sets all children (members) of a unit. If you want to add children to a unit,
you must first read the current children (Get Children), then add an entry to the collection
and then set the children. The assignement of organization units as children to other units must
be populated throughout the LSAOrga database using the method "LSAOrgaManager.PopulateAllChanges" or
the agent "LSAOrgEng cUpdate" of the LSAOrga database.
Use Case:
we want to set "Testperson" as Child into the "Projektgruppe" Project group
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim success As Integer
Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
Set Child = OrgaManager.GetUnitByName("TestPerson")
If Not aOrgaUnit Is Nothing And Not Child Is Nothing Then
Set allChildren = aOrgaUnit.Children
Call allChildren.addEntry (Child)
Set aOrgaUnit.Children = allChildren
success = aOrgaUnit.save
Delete aOrgaUnit
Delete Child
Call allChildren.deleteAll
End If
If success Then Call OrgaManager.PopulateAllChanges
- Parameters:
| Children | LSAOrgaCollection | all new children (members) of the unit
|
- History:
Public Property Get Children AsLSAOrgaCollection
This poperty returns a LSAOrgaCollection with all children (members) of a unit.
Use Case:
We read the children of the "Projektgruppe"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim allNames As String
Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
If Not aOrgaUnit Is Nothing Then
Set allChildren = aOrgaUnit.Children
Set Child = allChildren.GetFirst()
allNames = ""
While Not Child Is Nothing
If allNames = "" Then
allNames = Child.DisplayName
Else
allNames = allNames + "; " + Child.DisplayName
End If
Set Child = allChildren.GetNext()
Wend
Messagebox allNames
End If
- Returns:
| Children | LSAOrgaCollection
|
- History:
Public Property Get Traits AsLSAOrgaCollection
This property reads all traits of a unit (group or person) and returns them as a LSAOrgaCollection.
Traits with and without groups in the domino directory will be returned. They are calculated recursively.
Based on the traits returned e.g. buttons can be hidden or validations can be done dynamically.
Traits have to be set using the front end functionality.
Use Case:
We read the traits of the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Trait As LSAOrgaUnit
Dim allTraits As LSAOrgaCollection
Dim allNames As String
Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
If Not aOrgaUnit Is Nothing Then
Set allTraits = aOrgaUnit.Traits
Set Trait = allTraits.GetFirst()
allNames = ""
While Not Trait Is Nothing
If allNames = "" Then
allNames = Trait.DisplayName
Else
allNames = allNames + "; " + Trait.DisplayName
End If
Set Trait = allTraits.GetNext()
Wend
Messagebox allNames
End If
- Returns:
| Traits | LSAOrgaCollection all traits for the unit
|
- History:
Public Property Get ChangeRequests AsLSAOrgaChangeRequest
Public Property Get DefaultHierarchyPath AsString
Public Property Get UnitInstanceID AsString
Public Property Set AddrMgrID AsString
The id with which the LSAAddressManager has been checked in in the
InstanceManager.
Public Property Get AddrMgrID AsString
Public Property Get AddrMgr AsVariant
Returns a handle to the address manager object
New
Public Sub New(AttribCorrespondingDocument As NotesDocument,AttribDisplayName As String,AttribNotesName As String,AttribNotesType As String,AttribOrgaType As LSAOrgaType,orgaDB As NotesDatabase,OrgaLog As LSAOrgaLog,SurrogationDate As NotesDateTime,parViewAllUnits As NotesView,paraddrview As NotesView,addrMgrID As String)
This method is always called from the "LSAOrgaManager.NewUnit" method and is not for use by interface
programmers
Delete
Public Sub Delete
Due to some Lotus Script issues, unit objects should be deleted after they were saved for two reasons:
to release the memory and to make sure that the next time this object is accessed you really get the
currently valid data of this object as it might have been changed by some other functions.
Use Case:
A unit was saved , the memory shall be released
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success as integer
Set aOrgaUnit = OrgaManager.GetUnitByName("Department")
'.... some changes of the unit
success = aOrgaUnit.save
Delete aOrgaUnit
- History:
| 08.JUN.2000 | RGR | Delete the address data and check out
|
SetDefaultHierarchyFromParent
Public Function SetDefaultHierarchyFromParent(ParentUnit As Variant,as As Variant,LSAOrgaUnit As Variant) As Variant
This function sets the default hierarchy (specifies default hierarchy for address determination) according to
the parent units default hierarchy path; if that is not specified, the first hierarchy path of the parent unit
is taken as base for the hierarchy path of the current unit
Use Case:
we want to set in the Default hierarchy of the current unit according to the parent unit "Sales2", while the
current unit is "Salesman1" (while Salesman1 is a job in Sales2):
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Parent As LSAOrgaUnit
Dim aDefaultHierarchyPath as String
Set aOrgaUnit = OrgaManager.GetUnitByName("Salesman1")
Set Parent = OrgaManager.GetUnitByName("Sales2")
If Not aOrgaUnit Is Nothing and not Parent is Nothing Then
aDefaultHierarchyPath = aOrgaUnit.SetDefaultHierarchyFromParent(Parent)
success = aOrgaUnit.Save
End If
delete aOrgaUnit
delete Parent
- Parameters:
| ParentUnit | LSAOrgaUnit | , must be a valid parent of the current unit
|
- Errors:
| 1831 | "InvalidParentUnit" The unit which was passed as parameter is not a valid parent of the
current unit
|
- History:
SetChildsSurrogation
Public Sub SetChildsSurrogation(Child As LSAOrgaUnit,Surrogates As LSAOrgaCollection)
This function sets surrogates for members of a group (SurrogationRule). Each member of
a group can have specific surrogates for this group (in addition to a general surrogate).
Use Case:
we want to set in the Department "Sales2" a surrogate for the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim allSurrogates as LSAOrgaCollection
Dim SurrogationUnit as LSAOrgaUnits
Set aOrgaUnit = OrgaManager.GetUnitByName("Sales2")
Set SurrogationUnit = OrgaManager.GetUnitByName("Test") 'this is also a person unit
If Not aOrgaUnit Is Nothing and not SurrogationUnit is Nothing Then
Set allChildren = aOrgaUnit.Children
Set Child = allChildren.GetFirst()
allNames = ""
While Not Child Is Nothing
If Child.DisplayName = "Testperson" Then
set allSurrogates = aOrgaUnit.GetChildsSurrogation(Child)
call allSurrogates.AddEntry(SurrogationUnit)
call aOrgaUnit.SetChildsSurrogation(Child, allSurrogates)
success = aOrgaUnit.Save
Goto Done
End If
Set Child = allChildren.GetNext()
Wend
End If
Done:
delete aOrgaUnit
allSurrogates.DeleteAll
- Parameters:
| Child | LSAOrgaUnit | Member of the group
|
| Surrogates | LSAOrgaCollection | Collection of units that should be surrogates for the given member in the group.
|
- History:
GetChildsSurrogation
Public Function GetChildsSurrogation(Child As LSAOrgaUnit) As LSAOrgaCollection
Calculates for a given child-unit (parameter "Child") of the current unit a collection
of all surrogates.
Use Case:
we want to read all childrens surrogates of the "Sales2" department
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim allSurrogates as LSAOrgaCollection
Dim SurrogationUnit as LSAOrgaUnits
Dim allNames As String
Set aOrgaUnit = OrgaManager.GetUnitByName("Sales2")
If Not aOrgaUnit Is Nothing Then
Set allChildren = aOrgaUnit.Children
Set Child = allChildren.GetFirst()
allNames = ""
While Not Child Is Nothing
Set allSurrogates = aOrgaUnit.GetChildsSurrogation(Child)
Set SurrogationUnit = allSurrogates.GetFirst()
While Not SurrogationUnit Is Nothing
If allNames = "" Then
allNames = SurrogationUnit.DisplayName
Else
allNames = allNames + "; " + SurrogationUnit.DisplayName
End If
Messagebox child.Displayname + " is surrogated by: " + allNames
Set SurrogationUnit = allSurrogates.GetNext()
Wend
Set Child = allChildren.GetNext()
Wend
- Parameters:
| Child | LSAOrgaUnit | the child-unit
|
- Returns:
- History:
UpdateSerialData
Private Sub UpdateSerialData
WriteCustomerData
Public Sub WriteCustomerData(field As String,value As Variant)
This function writes data to a customer field of the unit.
Use Case:
we want to write some test data in the department "Sales2"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim Unit As LSAOrgaUnit
Dim TextList(1) As String
TextList(0) = "Text1"
TextList(1) = "Text2"
Set Unit = OrgaManager.GetUnitByName("Sales2")
Call Unit.WriteCustomerData("LSACDTime",Now)
Call Unit.WriteCustomerData("LSACDTextList",TextList)
Call Unit.Save
Delete unit
- Parameters:
| Field | String | the field name
|
| Value | Variant | the customer data
|
- History:
| 04.APR.2000 | gg | redesign
|
| 12.SEP.2000 | rp | set flag IsSummary
|
ReadCustomerData
Public Function ReadCustomerData(field As String) As Variant
This function reads data from a customer field of the unit.
Use Case:
we want to read the customer data in the department "Sales2"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim Unit As LSAOrgaUnit
Dim CustomerValue1 As Variant
Dim CustomerValue2 As Variant
'read CustomerData
Set Unit = OrgaManager.GetUnitByName("Sales2")
If Not unit Is Nothing Then
CustomerValue1 = Unit.ReadCustomerData("LSACDTime")
CustomerValue2 = Unit.ReadCustomerData("LSACDTextList")
End If
- Parameters:
| Field | String | the field name
|
- Returns:
| ReadCustomerData | Variant The data format depands on the field type.
|
- History:
Save
Public Function Save As Integer
This function saves a unit. If the unit is new, a document in the LSA Orga database is
created, if the unit is already part of the database, the document is saved (when properties
have changed). If any error occurs, the return value is "FALSE", and an entry is created in the Log
database indicating the reason that the units was not saved.
If changes were made that could affect other units, a chagne request document is created in the LSAOrga database.
In order to update all affected units (parents, childs), the method "PopulateAllChanges" of the LSAOrgaManager
or the agent "LSAOrgEng cUpdate" in the LSAOrga must be run.
Due to some LotusScript issues you should delete this object after a LSAOrgaUnit was saved:
to release the memory and to ensure that next time this object is accessed it contains the currently
valid values.
- Returns:
| Save | Integer True / False (successfull / unsuccessfull)
|
- History:
Remove
Public Sub Remove
This function removes a unit from the LSA Orga database. The document in the database
is not deleted at once, but only marked for deletion. In order to update all affected
units (parents, childs), the actual deletion takes place at update time (after running
PopulateAllChanges).
Trait groups or units which still hold relationships, or formula traits which still refer to other units must
not be removed! In these cases you first have to release all relational references from the unit you want to
remove, or specify and evaluate a formula in a formula trait that is empty, so the references from that trait
are removed in other units.
Use Case:
we want to remove the unit "Projektgruppe"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaType
Dim aUnitName As String
aUnitName = "Projektgruppe"
Set aOrgaUnit = OrgaManager.GetTypeByName(aUnitName)
Call aOrgaUnit.remove
Call OrgaManager.PopulateAllChanges
- History:
CreateUnitDoc
Private Function CreateUnitDoc As NotesDocument
SaveWithoutUpdate
Private Sub SaveWithoutUpdate(strPropertyName As String,vNewValue As Variant)
SetNotesTypeAccordingToType
Private Sub SetNotesTypeAccordingToType(strNABGroupType As String)
setAllPropertiesAccordingToType
Private Sub setAllPropertiesAccordingToType
validAliasNames
Private Function validAliasNames(AliasNamesToCheck As Variant) As Integer
ConvertFormula
Private Function ConvertFormula(Instring As String) As String
FormulaEvaluate
Private Function FormulaEvaluate(formula As String,doc As notesdocument) As Variant
HasChild
Private Function HasChild(Child As Variant,as As Variant,LSAOrgaUnit As Variant) As Variant
HasParent
Private Function HasParent(Parent As Variant,as As Variant,LSAOrgaUnit As Variant) As Variant
getPersonData
Public Function getPersonData As String
getOrganizationData
Public Function getOrganizationData As String
getDisplayName
Public Function getDisplayName As String
getOrganizationS
Public Function getOrganizationS As Variant
getReference
Public Function getReference As String
getCustomerContactSearchCriterias
Public Function getCustomerContactSearchCriterias As Variant
getCustomerOrganizationSearchCriterias
Public Function getCustomerOrganizationSearchCriterias As Variant
getCustomerSerialData
Public Function getCustomerSerialData As String
| Top | LotusScript Doc |
| © Lotus Professional Services |
| generated on : 05-Apr-01 8:39:59 AM |